<?php
// 网站页面配置文件
// 该文件已重构，配置内容已拆分到单独的文件中

// 网站根路径
$basePath = '';
$id = trim($_GET['s'] ?? 'home', '/');

$configs = [];
// 初始化页面配置数组
$pConfig = [
    'title' => '通用网站',
    'description' => '一个灵活的网站模板，支持任意主题内容',
    'keywords' => '',
    'viewport' => 'width=device-width, initial-scale=1.0',
    'generator' => 'PHP Content Management System',
    'charset' => 'UTF-8',
    'favicon' => '/favicon.ico',
    'analytics' => '',
    'theme' => 'default',
    'template' => '/templates/layout.php',
    'language' => 'zh-CN',
    'direction' => 'ltr',
    'body_class' => 'font-sans antialiased text-gray-900 bg-gray-50',
    'base_class' => '',
    'base_style' => '',
    'extra_css' => [],
    'extra_js' => [],
    'dependencies' => [],
    'components' => []
];

// 加载所有页面配置文件
try {
    $filePath = BASE_PATH . 'config/pages/' . $id. '.php';
    if(file_exists($filePath))
    {
        $configs = include $filePath;
    } else {
        $configs = include 'pages/home.php';
    }
    $pConfig = array_merge($pConfig, $configs);
} catch (Exception $e) {
    // 处理加载错误
    error_log('Failed to load page configurations: ' . $e->getMessage());
    // 提供默认配置以确保系统正常运行
    $pConfig = [];
}

// 返回完整的配置数组
return $pConfig;
    